/**
 * @Project TMHSCFX
 * @Author Tran Manh Hung
 * @Email: hungtmit@gmail.com | tmh@xwebgate.com
 * @Copyright © 2011 TMH. All rights reserved
 * @Createdate Apr 13, 2011
 * @Createtime 10:20:35 PM
 */

package com.tmh.study.fAS3AMTM.chap4
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.geom.ColorTransform;

	public class TransformColor extends Sprite
	{

		[Embed(source="assets/picture.jpg")]
		public var Picture:Class;

		public function TransformColor()
		{
			super();
			addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
		}

		private function addedToStageHandler(event:Event):void
		{
			initData();
		}

		private function initData():void
		{
			var pic:Bitmap = new Picture();
			addChild(pic);
			pic.transform.colorTransform = new ColorTransform(-1, 0, 0, 1, 0xff, 0x00, 0x00, 0);
		}
	}
}